<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.min.js"></script>
  </head>
  <body>
    <div id="app">
      <input v-model="msg" type="text" />
      <div>
        <input v-model="obj.name" type="text" />
        <input v-model="obj.age" type="text" />
      </div>
    </div>
    <script>
      new Vue({
        el: "#app",
        data: {
          msg: "",
          obj: {
            name: "张三",
            age: 20,
          },
        },
        watch: {
            msg(newValue,oldValue){
                console.log(newValue,oldValue);
            },
            obj:{
                deep: true,
                    handler(newValue) {
                        console.log(newValue)
                    }
            }
        },
      });
    </script>
  </body>
</html>
